<!--代码逻辑和样式库-->
<script src="./assign-permission.component.js"></script>
<style src="./assign-permission.scss" scoped lang="scss"></style>

<template>
  <div>
    <el-dialog :title="title" :visible.sync="showDialog" width="40%" @close="closeDialog()">
      <el-row :gutter="20">
        <el-col :span="8">
          <el-tree ref="menuTree" :data="treeData" :props="defaultProps" node-key="id" :expand-on-click-node="false" border default-expand-all highlight-current @node-click="getSelectNode">
            <span slot-scope="{ node }" class="custom-tree-node">
              <i class="el-icon-document" />
              <span class="">{{ node.label }}</span>
            </span>
          </el-tree>
        </el-col>
        <el-col :span="16">
          <el-table ref="treeTable" :data="data" highlight-current-row fit border @selection-change="selectedCodes">
            <el-table-column prop="name" label="名称" align="center" />
            <el-table-column prop="permission" label="操作码" align="center" />
            <el-table-column label="添加" type="selection" width="60" align="center" />
          </el-table>
        </el-col>
      </el-row>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" :loading="loading" @click="save()">保存</el-button>
        <el-button @click="showDialog = false">关闭</el-button>
      </span>
    </el-dialog>
  </div>
</template>
